import { createRouter, createWebHashHistory } from 'vue-router'
import home from '../view/home.vue'
import login from '../view/auth/login.vue'
import register from '../view/auth/register.vue'
import resetPassword from '../view/auth/resetPassword.vue'
import profile from '../view/profile.vue'
import survey from '../view/survey.vue'
import rewards from '../view/rewards.vue'
import messageInfo from '../view/messageInfo.vue'
import homepage from '../view/homepage.vue'
import choice from '../view/choice.vue'
import homeOdf from '../view/homeOdf.vue'
import user from '../view/user.vue'
import protocol from '../view/protocol.vue'

const routes = [
    {
        path: '/',
        redirect: '/home',
        meta:{
            keepAlive: true,
        }
    },
    {
        path: '/home',
        name: 'home',
        component: home
    },
    {
        path: '/login',
        name: 'login',
        component: login
    },
    {
        path: '/register',
        name: 'register',
        component: register
    },
    {
        path: '/resetPassword',
        name: 'resetPassword',
        component: resetPassword
    },
    {
        path: '/profile',
        name: 'profile',
        component: profile
    },
    {
        path: '/survey',
        name: 'survey',
        component: survey
    },
    {
        path: '/rewards',
        name: 'rewards',
        component: rewards
    },
    {
        path: '/messageInfo',
        name: 'messageInfo',
        component: messageInfo
    },
    {
        path: '/homepage',
        name: 'homepage',
        component: homepage
    },
    {
        path: '/choice',
        name: 'choice',
        component: choice
    },
    {
        path: '/homeOdf',
        name: 'homeOdf',
        component: homeOdf
    },
    {
        path: '/user',
        name: 'user',
        component: user
    },
    {
        path: '/protocol',
        name: 'protocol',
        component: protocol
    }
    
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router
